// @ts-ignore
import { api } from '@/utils/api';

/** 新增部门 POST /orgDeptInfo/add */
export async function orgDeptInfoAdd(
  body: BASE.AddDeptDto,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoAdd(
  body: BASE.AddDeptDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function orgDeptInfoAdd(
  body: BASE.AddDeptDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoAdd(
  body: BASE.AddDeptDto,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/orgDeptInfo/add`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/orgDeptInfo/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 删除部门 POST /orgDeptInfo/delete */
export async function orgDeptInfoDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function orgDeptInfoDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoDelete(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/orgDeptInfo/delete`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/orgDeptInfo/delete`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 编辑部门 POST /orgDeptInfo/edit */
export async function orgDeptInfoEdit(
  body: BASE.EditDeptDto,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoEdit(
  body: BASE.EditDeptDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function orgDeptInfoEdit(
  body: BASE.EditDeptDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoEdit(
  body: BASE.EditDeptDto,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/orgDeptInfo/edit`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/orgDeptInfo/edit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 根据部门id查询部门用户 POST /orgDeptInfo/getDeptUser */
export async function orgDeptInfoGetDeptUser(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultListOrgUserInfoVOduixiang>;

export async function orgDeptInfoGetDeptUser(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultListOrgUserInfoVOduixiang>>;

export async function orgDeptInfoGetDeptUser(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultListOrgUserInfoVOduixiang>;

export async function orgDeptInfoGetDeptUser(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultListOrgUserInfoVOduixiang>(`/app/orgDeptInfo/getDeptUser`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultListOrgUserInfoVOduixiang>(`/app/orgDeptInfo/getDeptUser`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 设置部门主管 POST /orgDeptInfo/setManager */
export async function orgDeptInfoSetManager(
  body: BASE.SetDeptManagerDto,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoSetManager(
  body: BASE.SetDeptManagerDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function orgDeptInfoSetManager(
  body: BASE.SetDeptManagerDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoSetManager(
  body: BASE.SetDeptManagerDto,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/orgDeptInfo/setManager`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/orgDeptInfo/setManager`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 根据前端传过来的参数排序 POST /orgDeptInfo/sortList */
export async function orgDeptInfoSortList(
  body: BASE.EditDeptDto[],
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoSortList(
  body: BASE.EditDeptDto[],
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function orgDeptInfoSortList(
  body: BASE.EditDeptDto[],
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function orgDeptInfoSortList(
  body: BASE.EditDeptDto[],
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/orgDeptInfo/sortList`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/orgDeptInfo/sortList`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取部门树形列表 POST /orgDeptInfo/treeList */
export async function orgDeptInfoTreeList(
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultListOrgDeptInfoVo>;

export async function orgDeptInfoTreeList(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultListOrgDeptInfoVo>>;

export async function orgDeptInfoTreeList(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultListOrgDeptInfoVo>;

export async function orgDeptInfoTreeList(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultListOrgDeptInfoVo>(`/app/orgDeptInfo/treeList`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultListOrgDeptInfoVo>(`/app/orgDeptInfo/treeList`, {
    method: 'POST',
    ...(options || {})
  });
}
